﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using DTO;
using BUS;

namespace WebSieuThi.ThuNgan
{
    public partial class KhachHangThanThiet : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string ten = TextBox6.Text.ToString();
            string gt = TextBox1.Text.ToString();
            string cmnd = TextBox7.Text.ToString();
            string dc = TextBox8.Text.ToString();
            string sdt = TextBox9.Text.ToString();

            DTO.KhachHangThanThiet kh1 = new DTO.KhachHangThanThiet();
            kh1 = KhachHangThanThietBUS.timhd();


            DTO.KhachHangThanThiet kh = new DTO.KhachHangThanThiet();
            kh.MaKH = "KH" + (kh1.Id + 1).ToString();
            kh.TenKH = ten;
            kh.GioiTinh = gt;
            kh.Cmnd = cmnd;
            kh.DiaChi = dc;
            kh.Sdt = sdt;
            kh.SoDiemTichLuy = 0;

            bool b = KhachHangThanThietBUS.Them(kh);
            if (b)
                kqthem.InnerHtml = "Thêm thành công";



        }
    }
}
